package com.example.film.service;

import com.example.film.entity.PublishInfo;
import com.example.film.mapper.PublishInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PublishInfoServiceImpl implements PublishInfoService{
    @Autowired
    private PublishInfoMapper publishInfoMapper;

    @Override
    public List<PublishInfo> findPublishInfo() {
        return publishInfoMapper.findPublishInfo();
    }

    @Override
    public List<PublishInfo> findPublishMessage(Integer pageNum, Integer pageSize) {
        int startIndex = (pageNum - 1) * pageSize;
        return publishInfoMapper.findPublishMessage(startIndex,pageSize);
    }

    @Override
    public List<PublishInfo> findPublishInfoByDate(Integer year, Integer month) {
        return publishInfoMapper.findPublishInfoByDate(year, month);
    }
}
